<html>
<head><meta charset="utf-8"><title>marker_trait_attr stabilization · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html">marker_trait_attr stabilization</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237355952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237355952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237355952">(May 04 2021 at 16:24)</a>:</h4>
<p>I want to push <code>feature(marker_trait_attr)</code> <a href="https://github.com/rust-lang/rust/issues/29864">#29864</a> to stabilization. Going to use this topic to talk about the remaining blockers <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237356005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237356005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237356005">(May 04 2021 at 16:24)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> are you still interested in this?</p>



<a name="237356166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237356166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237356166">(May 04 2021 at 16:25)</a>:</h4>
<p>I unfortunately don't have the time to lead this, but I'll definitely keep up with the progress and see if I can provide help</p>



<a name="237356553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237356553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237356553">(May 04 2021 at 16:28)</a>:</h4>
<h1>attribute name or explicit syntax or whatever</h1>



<a name="237356617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237356617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237356617">(May 04 2021 at 16:28)</a>:</h4>
<p>i don't think this needs an rfc</p>



<a name="237356712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237356712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237356712">(May 04 2021 at 16:28)</a>:</h4>
<p>and I also don't think it matters much tbh</p>



<a name="237357056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237357056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237357056">(May 04 2021 at 16:30)</a>:</h4>
<p>for searchability I personally slightly prefer <code>#[marker_trait]</code> instead of just <code>#[marker]</code> so I might just change it to that in the stabilization pr and get <code>t-lang</code> to figure it out</p>



<a name="237357134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237357134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237357134">(May 04 2021 at 16:31)</a>:</h4>
<p>(taking <a href="https://github.com/rust-lang/rust/issues/29864#issuecomment-676332502">https://github.com/rust-lang/rust/issues/29864#issuecomment-676332502</a> as a reference for now)</p>



<a name="237360794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237360794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237360794">(May 04 2021 at 16:55)</a>:</h4>
<p>So, this might be a bit heavy-handed. But, looking forward to a future where we have Chalk as a trait solver, I feel like when we stabilize features going forward that fundamentally alter the semantics of trait solving (e.g. marker traits , <code>fundamental</code>, GATs, named impl trait, specialization), I feel like we should try to define the behavior a bit more formally, or at least how this would work in Chalk.</p>
<p>Here, it's really not difficult, since it's just "marker traits can have overlapping impls" and marker traits are already implemented in Chalk. But I think it's a good precedent to set? At least, this is my opinion</p>



<a name="237360914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237360914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237360914">(May 04 2021 at 16:55)</a>:</h4>
<p>For this specifically, on <code>marker</code> vs <code>marker_trait</code>: whichever way we choose, we should follow the same style for <code>fundamental</code> (though, <code>fundamental</code> might not be the best name)</p>



<a name="237361928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237361928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237361928">(May 04 2021 at 17:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237357056">said</a>:</p>
<blockquote>
<p>for searchability I personally slightly prefer <code>#[marker_trait]</code> instead of just <code>#[marker]</code> so I might just change it to that in the stabilization pr and get <code>t-lang</code> to figure it out</p>
</blockquote>
<p>flip flop, we use <code>#[non_exhaustive]</code> without specifying what's non exhaustive as part of the attribute name, so I am once again in favor of just <code>marker</code></p>



<a name="237362032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237362032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237362032">(May 04 2021 at 17:02)</a>:</h4>
<p>I suppose <code>marker trait Foo {}</code> is out of the question?</p>



<a name="237362051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237362051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237362051">(May 04 2021 at 17:03)</a>:</h4>
<blockquote>
<p>I feel like we should try to define the behavior a bit more formally, or at least how this would work in Chalk.</p>
</blockquote>
<p>that definitely seems useful to me, though I am probably not that helpful for this</p>



<a name="237362388"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237362388" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237362388">(May 04 2021 at 17:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237362032">said</a>:</p>
<blockquote>
<p>I suppose <code>marker trait Foo {}</code> is out of the question?</p>
</blockquote>
<p>i've also seen <code>trait Foo;</code> for this, but i don't think adding a (contextual) keyword for this is worth it, considering how rarely this feature is needed</p>



<a name="237364141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364141">(May 04 2021 at 17:15)</a>:</h4>
<h1>orphan rules</h1>



<a name="237364164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364164">(May 04 2021 at 17:15)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/67919">#67919</a></p>



<a name="237364297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364297">(May 04 2021 at 17:16)</a>:</h4>
<p>the example in that issue is </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// crate a</span>
<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="c1">// crate b</span>
<span class="k">struct</span> <span class="nc">Bar</span><span class="p">;</span><span class="w"></span>
<span class="c1">// crate c</span>
<span class="k">impl</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="237364314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364314">(May 04 2021 at 17:16)</a>:</h4>
<p>this is unsound</p>



<a name="237364506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364506">(May 04 2021 at 17:17)</a>:</h4>
<p>or like, it is if <code>impl &lt;T: MarkerTrait&gt; NonMarker for T {}</code> is allowed in to exist together with <code>impl NonMarker for MyType</code></p>



<a name="237364582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364582">(May 04 2021 at 17:18)</a>:</h4>
<p>cc <a href="https://github.com/rust-lang/rust/issues/67919#issuecomment-575315025">https://github.com/rust-lang/rust/issues/67919#issuecomment-575315025</a></p>



<a name="237364780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237364780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237364780">(May 04 2021 at 17:19)</a>:</h4>
<p>i highly doubt we want to consider these impls to overlap</p>



<a name="237365504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237365504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237365504">(May 04 2021 at 17:24)</a>:</h4>
<p>using specialization for this and saying something like "<code>impl &lt;T: MarkerTrait&gt; NonMarker for T {}</code> can be specialized by arbitrary impls" might work</p>



<a name="237366560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237366560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237366560">(May 04 2021 at 17:31)</a>:</h4>
<p>but seems like a huge mess, i.e. <code>NonMarker</code> can have associated types. This has all the lifetime unsoundness issues as it <em>has to</em> use the specializing impl if it applies</p>



<a name="237366678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237366678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237366678">(May 04 2021 at 17:32)</a>:</h4>
<p>i guess cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> but I don't think relaxing the orphan rules for marker traits is something we want</p>



<a name="237366906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237366906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237366906">(May 04 2021 at 17:34)</a>:</h4>
<h1>negative impls</h1>
<p>If we don't relax orphan rules, we only have to prevent pos/neg overlaps, so this seems fairly straightforward to me</p>



<a name="237367425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367425">(May 04 2021 at 17:37)</a>:</h4>
<hr>
<p>with this I've gone through all relevant issues/concerns I was able to find</p>



<a name="237367478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367478">(May 04 2021 at 17:37)</a>:</h4>
<p>was there a comment about allowing <code>impl&lt;T: Foo&gt; Marker for T::Assoc {}</code> ?</p>



<a name="237367557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367557">(May 04 2021 at 17:38)</a>:</h4>
<p>so I guess it's time to fix <a href="https://github.com/rust-lang/rust/issues/84917">#84917</a></p>



<a name="237367580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367580">(May 04 2021 at 17:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237367478">said</a>:</p>
<blockquote>
<p>was there a comment about allowing <code>impl&lt;T: Foo&gt; Marker for T::Assoc {}</code> ?</p>
</blockquote>
<p>uuuuh~~~~~~~~~~~</p>



<a name="237367602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367602">(May 04 2021 at 17:38)</a>:</h4>
<p>idk, but that seems interesting</p>



<a name="237367606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367606">(May 04 2021 at 17:38)</a>:</h4>
<p>I mean im guessing such an impl is off the table if you dont want to relax orphan rules</p>



<a name="237367745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367745">(May 04 2021 at 17:39)</a>:</h4>
<p>it's also not a breaking change to allow such an impl later <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="237367769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367769">(May 04 2021 at 17:39)</a>:</h4>
<p>so I am just going to ignore this for now</p>



<a name="237367959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237367959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237367959">(May 04 2021 at 17:40)</a>:</h4>
<p><span class="user-mention silent" data-user-id="326176">Boxy</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237367606">said</a>:</p>
<blockquote>
<p>I mean im guessing such an impl is off the table if you dont want to relax orphan rules</p>
</blockquote>
<p>it seems really difficult, y</p>



<a name="237368127"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368127" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368127">(May 04 2021 at 17:41)</a>:</h4>
<p>without adding restrictions on the associated types of <code>Foo</code> in some way that doesn't seem possible to me</p>



<a name="237368288"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368288" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368288">(May 04 2021 at 17:42)</a>:</h4>
<p>we could however allow</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="k">const</span><span class="w"> </span><span class="n">N</span>: <span class="kt">usize</span><span class="o">&gt;</span><span class="w"> </span><span class="n">MarkerTrait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="n">complex_expr_using_N</span><span class="p">]</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="237368302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368302">(May 04 2021 at 17:42)</a>:</h4>
<p>that seems fine to me</p>



<a name="237368363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368363">(May 04 2021 at 17:42)</a>:</h4>
<p>i also don't really know how trait selection would work for this</p>



<a name="237368412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368412">(May 04 2021 at 17:43)</a>:</h4>
<p>because to know whether <code>[u8; 7]</code> implements <code>MarkerTrait</code></p>



<a name="237368535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368535">(May 04 2021 at 17:43)</a>:</h4>
<p>we would have to either try all <code>N</code> or try and reverse <code>complex_expr_using_N</code>, both of which don't seem possible <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> so never mind</p>



<a name="237368742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368742">(May 04 2021 at 17:44)</a>:</h4>
<p>plans foiled by usize::MAX being a very large number</p>



<a name="237368895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368895">(May 04 2021 at 17:44)</a>:</h4>
<p>plans foiled by <code>&amp;str</code> having infinitely many values</p>



<a name="237368913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368913">(May 04 2021 at 17:44)</a>:</h4>
<p>uwu</p>



<a name="237368998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237368998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237368998">(May 04 2021 at 17:45)</a>:</h4>
<p>oh yeah that would do it too <span aria-label="rofl" class="emoji emoji-1f923" role="img" title="rofl">:rofl:</span></p>



<a name="237371224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237371224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237371224">(May 04 2021 at 17:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237367557">said</a>:</p>
<blockquote>
<p>so I guess it's time to fix <a href="https://github.com/rust-lang/rust/issues/84917">#84917</a></p>
</blockquote>
<p>soo</p>



<a name="237371343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237371343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237371343">(May 04 2021 at 18:00)</a>:</h4>
<p>i <em>assume</em> (too lazy to check) that this happens because when checking the wf of the <code>impl&lt;T&gt; F for T where T: Copy {}</code> impl</p>



<a name="237371425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237371425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237371425">(May 04 2021 at 18:01)</a>:</h4>
<p>we have to prove the <em>normally trivial</em> predicate <code>T: Copy implies T: F</code></p>



<a name="237371477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237371477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237371477">(May 04 2021 at 18:01)</a>:</h4>
<p>which is obviously does, because we're in exactly that impl</p>



<a name="237371609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237371609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Boxy [she/her] <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237371609">(May 04 2021 at 18:02)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237371343">said</a>:</p>
<blockquote>
<p>i <em>assume</em> (to lazy to check) that this happens because when checking the wf of the <code>impl&lt;T&gt; F for T where T: Copy {}</code> impl</p>
</blockquote>
<p><a href="/user_uploads/4715/9K2VpHMZ4t_4OlRt0wAuaJ0s/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/9K2VpHMZ4t_4OlRt0wAuaJ0s/image.png" title="image.png"><img src="/user_uploads/4715/9K2VpHMZ4t_4OlRt0wAuaJ0s/image.png"></a></div>



<a name="237372143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237372143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237372143">(May 04 2021 at 18:05)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/a5f164faad4a2fed606b8160fd7ecd2d5cbba381/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1497">https://github.com/rust-lang/rust/blob/a5f164faad4a2fed606b8160fd7ecd2d5cbba381/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1497</a></p>



<a name="237372426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237372426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237372426">(May 04 2021 at 18:07)</a>:</h4>
<p>I guess we don't want to drop victim if victim is <code>EvaluatedToOk</code> <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237372522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237372522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237372522">(May 04 2021 at 18:07)</a>:</h4>
<p>but that still leaves the case of two <code>EvaluatedToOkModuloRegions</code></p>



<a name="237374345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237374345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237374345">(May 04 2021 at 18:20)</a>:</h4>
<p>or for 2 <code>EvaluatedToOk</code></p>



<a name="237375327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237375327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237375327">(May 04 2021 at 18:26)</a>:</h4>
<p>i think ideally we would keep the multiple impls as candidates and then just try all of them during borrowck? <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237375385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237375385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237375385">(May 04 2021 at 18:26)</a>:</h4>
<p>i don't know how easy that is <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237377253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237377253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237377253">(May 04 2021 at 18:37)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtInner.html#structfield.region_obligations">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtInner.html#structfield.region_obligations</a></p>



<a name="237377391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237377391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237377391">(May 04 2021 at 18:38)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtInner.html#structfield.region_constraint_storage">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxtInner.html#structfield.region_constraint_storage</a></p>



<a name="237377416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237377416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237377416">(May 04 2021 at 18:38)</a>:</h4>
<p>ok, that definitely doesn't seem trivial to implement</p>



<a name="237377429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237377429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237377429">(May 04 2021 at 18:38)</a>:</h4>
<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237380040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237380040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237380040">(May 04 2021 at 18:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237372426">said</a>:</p>
<blockquote>
<p>I guess we don't want to drop victim if victim is <code>EvaluatedToOk</code> <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>
</blockquote>
<p>implemented in <a href="https://github.com/rust-lang/rust/issues/84922">#84922</a>, we now don't discard <code>EvaluatedToOk</code> in favor of <code>EvaluatedToOkModuloRegions</code></p>



<a name="237380317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237380317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237380317">(May 04 2021 at 18:59)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(marker_trait_attr)]</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span>: <span class="o">'</span><span class="nb">static</span> <span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="237380453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237380453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237380453">(May 04 2021 at 19:00)</a>:</h4>
<p>this example is still broken after <a href="https://github.com/rust-lang/rust/issues/84922">#84922</a>, as both candidates have region obligations</p>



<a name="237380497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237380497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237380497">(May 04 2021 at 19:00)</a>:</h4>
<p>(the first one has an implicit <code>T: 'a</code> obligation)</p>



<a name="237491697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237491697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237491697">(May 05 2021 at 13:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232957">Jack Huey</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237360794">said</a>:</p>
<blockquote>
<p>So, this might be a bit heavy-handed. But, looking forward to a future where we have Chalk as a trait solver, I feel like when we stabilize features going forward that fundamentally alter the semantics of trait solving (e.g. marker traits , <code>fundamental</code>, GATs, named impl trait, specialization), I feel like we should try to define the behavior a bit more formally, or at least how this would work in Chalk.</p>
<p>Here, it's really not difficult, since it's just "marker traits can have overlapping impls" and marker traits are already implemented in Chalk. But I think it's a good precedent to set? At least, this is my opinion</p>
</blockquote>
<p>I approve of this</p>



<a name="237491745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237491745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237491745">(May 05 2021 at 13:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237366678">said</a>:</p>
<blockquote>
<p>i guess cc <span class="user-mention silent" data-user-id="116009">nikomatsakis</span> but I don't think relaxing the orphan rules for marker traits is something we want</p>
</blockquote>
<p>agreed</p>



<a name="237491813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237491813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237491813">(May 05 2021 at 13:10)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> I'm of the opinion we can and should stabilize marker traits</p>



<a name="237491875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237491875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237491875">(May 05 2021 at 13:10)</a>:</h4>
<p>(deleted)</p>



<a name="237492068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237492068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237492068">(May 05 2021 at 13:11)</a>:</h4>
<p>I also agree with <span class="user-mention" data-user-id="232957">@Jack Huey</span> that we want to be modeling things in chalk -- I'd say <em>before</em> stabilization</p>



<a name="237492084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237492084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237492084">(May 05 2021 at 13:11)</a>:</h4>
<p>but certainly by then</p>



<a name="237492101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237492101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237492101">(May 05 2021 at 13:11)</a>:</h4>
<p>that said, I think that modeling this is fairly straightforward</p>



<a name="237492152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237492152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237492152">(May 05 2021 at 13:12)</a>:</h4>
<p>it sounds like we need a stabilization report</p>



<a name="237495262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495262">(May 05 2021 at 13:32)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237380317">said</a>:</p>
<blockquote>
<p><div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(marker_trait_attr)]</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="na">a</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">F</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">T</span>: <span class="o">'</span><span class="nb">static</span> <span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div><br>
</p>
</blockquote>
<p>i expect us to not fix this before stabilization <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> should be backwards compatible to fix after stabilization and unlikely enough.</p>



<a name="237495305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495305">(May 05 2021 at 13:32)</a>:</h4>
<blockquote>
<p>it sounds like we need a stabilization report</p>
</blockquote>
<p>yes</p>



<a name="237495638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495638">(May 05 2021 at 13:34)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> what is current behavior?</p>



<a name="237495650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495650">(May 05 2021 at 13:34)</a>:</h4>
<p>for that example?</p>



<a name="237495732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495732">(May 05 2021 at 13:35)</a>:</h4>
<p>a compile error when while checking wf for the first impl</p>



<a name="237495819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495819">(May 05 2021 at 13:36)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error[E0477]: the type `&amp;&#39;a T` does not fulfill the required lifetime
 --&gt; src/main.rs:5:13
  |
5 | impl&lt;&#39;a, T&gt; F for &amp;&#39;a T {}
  |             ^
  |
  = note: type must satisfy the static lifetime
</code></pre></div>



<a name="237495892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495892">(May 05 2021 at 13:36)</a>:</h4>
<p>during winnowing, we see two impl candidates with <code>EvaluatedToOkModuloRegions</code> so we just take one of those at random</p>



<a name="237495929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495929">(May 05 2021 at 13:37)</a>:</h4>
<p>oh hmm</p>



<a name="237495939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495939">(May 05 2021 at 13:37)</a>:</h4>
<p>I don't like that :)</p>



<a name="237495985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237495985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237495985">(May 05 2021 at 13:37)</a>:</h4>
<p>it's not so much the behavior I dislike</p>



<a name="237496013"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237496013" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237496013">(May 05 2021 at 13:37)</a>:</h4>
<p>I just want to review the winnowing behavior, sounds...risky</p>



<a name="237496333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237496333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237496333">(May 05 2021 at 13:39)</a>:</h4>
<blockquote>
<p>we just take one of those at random</p>
</blockquote>
<p>only for marker traits, where it's irrelevant which candidate actually applies. So for <code>EvaluatedToOk</code> this definitely seems fine to me.<br>
For <code>EvaluatedToOkModuloRegions</code> I don't think there's much we can do here without changing the way we store and deal with region obligations</p>



<a name="237496412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237496412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237496412">(May 05 2021 at 13:40)</a>:</h4>
<p>(we also only do so if there are no inference variables present, so this <del>can't</del>(edit: shouldn't) influence type inference)</p>



<a name="237496579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237496579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237496579">(May 05 2021 at 13:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237496013">said</a>:</p>
<blockquote>
<p>I just want to review the winnowing behavior, sounds...risky</p>
</blockquote>
<p>though of course, if you have the time it also doesn't hurt for you to look over that as well <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="237496837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237496837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237496837">(May 05 2021 at 13:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237495305">said</a>:</p>
<blockquote>
<blockquote>
<p>it sounds like we need a stabilization report</p>
</blockquote>
<p>yes</p>
</blockquote>
<p>ah I forgot to write that: I intend to write this stabilization report myself in the next few days, but don't know what to do wrt modeling this in chalk, so that's something I need some help with</p>



<a name="237497175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497175">(May 05 2021 at 13:45)</a>:</h4>
<p>/me wonders if we discuss marker traits in the chalk book</p>



<a name="237497277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497277">(May 05 2021 at 13:46)</a>:</h4>
<p><a href="https://github.com/rust-lang/chalk/blob/a0eac73f60ad0ab1de2075def346bd5a5f2352cd/chalk-solve/src/coherence/solve.rs#L20">this</a> is the only "use" of marker traits in Chalk</p>



<a name="237497290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497290">(May 05 2021 at 13:46)</a>:</h4>
<p>i.e. the only thing they change</p>



<a name="237497348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497348">(May 05 2021 at 13:47)</a>:</h4>
<p>i.e. impls of marker traits are allowed to overlap</p>



<a name="237497368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497368">(May 05 2021 at 13:47)</a>:</h4>
<p>isn't this incorrect?</p>



<a name="237497414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497414">(May 05 2021 at 13:47)</a>:</h4>
<p>marker traits are only allowed to overlap if they have the same polarity</p>



<a name="237497417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497417">(May 05 2021 at 13:47)</a>:</h4>
<p>How?</p>



<a name="237497442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497442">(May 05 2021 at 13:47)</a>:</h4>
<p><code>impl !Marker</code> and <code>impl Marker</code> must not overlap</p>



<a name="237497477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497477">(May 05 2021 at 13:47)</a>:</h4>
<p>Ah...hmm..</p>



<a name="237497543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497543">(May 05 2021 at 13:48)</a>:</h4>
<p>Yeah that might be a bug</p>



<a name="237497651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497651">(May 05 2021 at 13:49)</a>:</h4>
<p><em>does chalk have something similar to <code>candidate_should_be_dropped_in_favor_of</code>?</em></p>



<a name="237497679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497679">(May 05 2021 at 13:49)</a>:</h4>
<p>No</p>



<a name="237497713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497713">(May 05 2021 at 13:49)</a>:</h4>
<p>Well...I guess the <code>ClausePriority</code> is <em>similiar</em></p>



<a name="237497811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237497811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237497811">(May 05 2021 at 13:50)</a>:</h4>
<p>but only used in the recursive solver for assoc type projections</p>



<a name="237498851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498851">(May 05 2021 at 13:57)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237496333">said</a>:</p>
<blockquote>
<blockquote>
<p>we just take one of those at random</p>
</blockquote>
<p>only for marker traits, where it's irrelevant which candidate actually applies. So for <code>EvaluatedToOk</code> this definitely seems fine to me.<br>
For <code>EvaluatedToOkModuloRegions</code> I don't think there's much we can do here without changing the way we store and deal with region obligations</p>
</blockquote>
<p>well, it's not irrelevant, is it?</p>



<a name="237498870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498870">(May 05 2021 at 13:57)</a>:</h4>
<p>that is, this is an example where it's not irrelevant :)</p>



<a name="237498898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498898">(May 05 2021 at 13:57)</a>:</h4>
<p>it's irrelevant "modulo regions", to some extent</p>



<a name="237498950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498950">(May 05 2021 at 13:57)</a>:</h4>
<p>I don't believe marker traits need any <em>modeling</em> in chalk per se</p>



<a name="237498960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498960">(May 05 2021 at 13:57)</a>:</h4>
<p>they only affect coherence</p>



<a name="237498988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237498988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237498988">(May 05 2021 at 13:58)</a>:</h4>
<p>one of the design goals for chalk is to accommodate multiple routes to proving the same thing better</p>



<a name="237499069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499069">(May 05 2021 at 13:58)</a>:</h4>
<p>that said, we do have to figure out how to merge region constraints and "post-conditions", which is relevant to the above problem</p>



<a name="237499109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499109">(May 05 2021 at 13:58)</a>:</h4>
<p>tbh the answer I want to do is just to not have that problem any more, by integrating region checking and things into one giant logical clause</p>



<a name="237499118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499118">(May 05 2021 at 13:58)</a>:</h4>
<p>and a more capable solver</p>



<a name="237499343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499343">(May 05 2021 at 14:00)</a>:</h4>
<p>Are you already looking forward to a post-Chalk era <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237499385"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499385" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499385">(May 05 2021 at 14:00)</a>:</h4>
<p>basically :P</p>



<a name="237499430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499430">(May 05 2021 at 14:00)</a>:</h4>
<p>but in the meantime I would just convert from <code>A | B</code> to <code>A &amp; B</code></p>



<a name="237499459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237499459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237499459">(May 05 2021 at 14:00)</a>:</h4>
<p>or something like that :)</p>



<a name="237504825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237504825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237504825">(May 05 2021 at 14:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237499430">said</a>:</p>
<blockquote>
<p>but in the meantime I would just convert from <code>A | B</code> to <code>A &amp; B</code></p>
</blockquote>
<p>can you elaborate on this?</p>



<a name="237522884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237522884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237522884">(May 05 2021 at 16:12)</a>:</h4>
<p>This thread motivated me to play around with <code>#![feature(marker_trait_attr)]</code> for a little bit and—well, you said you’re interested in “the remaining blockers”—I found some soundness issue in the current implementation <a href="https://github.com/rust-lang/rust/issues/84955">#84955</a></p>



<a name="237528676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237528676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237528676">(May 05 2021 at 16:51)</a>:</h4>
<p>that's definitely an impressive find ^^</p>



<a name="237530599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237530599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237530599">(May 05 2021 at 17:03)</a>:</h4>
<p><span class="user-mention" data-user-id="280891">@Frank Steffahn</span> was there anything specific you tried to find this?</p>



<a name="237533021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237533021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237533021">(May 05 2021 at 17:19)</a>:</h4>
<p>Well, yeah, I tried to get a feeling of how smart the overlap detection is. The first time I got an overlap, my source file looked like this</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(marker_trait_attr)]</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">As1</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">As</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Blah</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Marker1</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span>: <span class="nc">As1</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">Blah</span><span class="o">&lt;</span><span class="bp">Self</span>::<span class="n">As</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Mark</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Mark</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Mark</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">Mark</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="c1">// doesn’t work: impl Bar for (u8,) {}</span>
<span class="c1">// but this does:</span>
<span class="k">impl</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">((</span><span class="kt">u8</span><span class="p">,),)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">C</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">C</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">T</span><span class="p">,)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">C</span><span class="o">&gt;</span><span class="w"> </span><span class="n">C</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">T</span><span class="p">,)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">C</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>
<p>so yeah… much of it is a bunch of impls from trying to get a feeling for what the compiler likes and what it doesn’t. My initial assumption was that the compiler might have some weaknesses that can lead to overlapping impls because of the error cases with <code>T: 'static</code> you posted above, where it apparently quite eagerly applied its knowledge about an existing other blanket impl while checking the soundness of a trait impl. So thus I played around with maximally generic blanket impls. Also the example involves need for negative reasoning to know if the <code>impl Bar for ((u8,),) {}</code> impl overlaps with the other one. I tried out to get some unsoundness with negative reasoning (if there was any unsoundness) since it felt like a natural way in which the compiler getting confused about multiple blanket impls (in particular <em>missing/forgetting about</em> one of them) would be unsound.</p>
<p>By the way, I already hit some weird seemingly order-sensitive or whitespace-sensitive behavior when first adding the four impls</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>
<p>(the first one was at the end initially) so it seems like that issue is not too hard to come across either.</p>
<p>The example in the issue is really just about using associated types and fn pointers to create some unsound transmutation and then minimizing the code example. (BTW, minimization is <em>surprisingly annoying</em> when compiler has incremental compilation issues that you haven’t figured out yet that it’s incr-comp related and <code>cargo clean</code> would’ve helped.)</p>



<a name="237533925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237533925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237533925">(May 05 2021 at 17:25)</a>:</h4>
<p>An earlier step involved some more deeply nested types <code>((((((((((u8,),),),),),),),),),)</code>. I was curious about how far the overlap checking would go. In particular when the overlapping marker trait impls offer so much “non-determinism”. I guess the motivation for that step initially was more about trying to find out what kind of recursion limits or similar I could hit until the compiler would give up on trying to get a definite answer on if there was an overlap, so I was maybe more curious about what kinds of error messages I might get than necessarily expecting to hit unsoundness.</p>



<a name="237536250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237536250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237536250">(May 05 2021 at 17:40)</a>:</h4>
<p>thanks &lt;3</p>



<a name="237543558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237543558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237543558">(May 05 2021 at 18:28)</a>:</h4>
<p>Here's a version of the MWE that focuses on the incr-comp issue:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(marker_trait_attr)]</span><span class="w"></span>

<span class="fm">macro_rules!</span><span class="w"> </span><span class="n">assert_impl</span><span class="w"> </span><span class="p">{(</span><span class="cp">$ty</span>:<span class="nc">ty</span>: <span class="cp">$($trait</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">_</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">f</span><span class="o">&lt;</span><span class="n">T</span>: <span class="cp">$($trait</span><span class="p">)</span><span class="o">*&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="k">fn</span> <span class="nf">g</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">f</span>::<span class="o">&lt;</span><span class="cp">$ty</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="p">}}</span><span class="w"></span>

<span class="cp">#[marker]</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="o">&gt;</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="w"> </span><span class="n">A</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">T</span><span class="p">,)</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// asked directly:</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(((</span><span class="kt">u8</span><span class="p">,),)</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// fails</span>

<span class="c1">// but walk it through the steps and it works:</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">B</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">((</span><span class="kt">u8</span><span class="p">,)</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">((</span><span class="kt">u8</span><span class="p">,)</span>: <span class="nc">B</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">((</span><span class="kt">u8</span><span class="p">,)</span>: <span class="nc">A</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">B</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(((</span><span class="kt">u8</span><span class="p">,),)</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok.. wait</span>

<span class="c1">// This abbreviated path also works:</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">((</span><span class="kt">u8</span><span class="p">,)</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(((</span><span class="kt">u8</span><span class="p">,),)</span>: <span class="nc">A</span><span class="p">);</span><span class="w"> </span><span class="c1">// ok</span>
</code></pre></div>
<p>You have to comment out the first <code>assert_impl!(((u8,),): A);</code> to see the second one work</p>



<a name="237545296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237545296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237545296">(May 05 2021 at 18:39)</a>:</h4>
<p>I believe these impl tests are also why the coherence check fails to notice the overlap; it is doing the equivalent of <code>assert_no_impl!(((u8,),): A);</code> which spuriously succeeds. I haven't found a way to walk it through the steps like above, because trait coherence checking seems to happen before function body typechecking, which is used to implement <code>assert_impl!</code> here</p>



<a name="237546080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237546080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237546080">(May 05 2021 at 18:45)</a>:</h4>
<p>Damn, that’s an insanely useful macro idea. Should’ve thought of something like that myself for my experimentations <a href="https://github.com/rust-lang/rust/issues?q=author%3Asteffahn+label%3AA-traits">the past few weaks</a> often involving traits. I wouldn’t know how often I coded up helper functions to do exactly that, especially for testing <code>𝑇𝑦𝑝𝑒: 'static</code> bounds.</p>



<a name="237546591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237546591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237546591">(May 05 2021 at 18:48)</a>:</h4>
<p>You might like this one as well for the coherence checking then:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">assert_no_impl</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="cp">$ty</span>:<span class="nc">ty</span>: <span class="cp">$($trait</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="n">_</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="k">trait</span><span class="w"> </span><span class="n">Trait</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">            </span><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="cp">$($trait</span><span class="p">)</span><span class="o">*&gt;</span><span class="w"> </span><span class="n">Trait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">            </span><span class="k">impl</span><span class="w"> </span><span class="n">Trait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="cp">$ty</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="w">        </span><span class="p">};</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="237547384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237547384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237547384">(May 05 2021 at 18:54)</a>:</h4>
<p>Actually, you might want to add some <code>assert_implication!([S,T][T: From&lt;S&gt;] S: Into&lt;T&gt;)</code> version (syntax to be debated).</p>



<a name="237547667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237547667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237547667">(May 05 2021 at 18:56)</a>:</h4>
<p>This is the quick and dirty version. I think the <code>static_assertions</code> crate has much more elaborate versions of these macros</p>



<a name="237548255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237548255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237548255">(May 05 2021 at 19:00)</a>:</h4>
<p>Alright, that’s a nice crate I’ve never heard of… however I can’t find anything that could test implications like that. I remember having a case where <code>T: A -&gt; T: B</code> did work but <code>T: A + C -&gt; T: B</code> didn’t (<code>-&gt;</code>arrow means implication) while playing around and finding <a href="https://github.com/rust-lang/rust/issues/84955">#84955</a>. Of course tested with something like <code>fn f&lt;T: A&gt;() { g::&lt;T&gt;(); } fn g&lt;T: B&gt;() {}</code>.</p>



<a name="237548499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237548499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237548499">(May 05 2021 at 19:02)</a>:</h4>
<p>ha, I wonder whether it would be possible to just have a chalk style FOL formula transformed into a rust impl pattern</p>



<a name="237548906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237548906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237548906">(May 05 2021 at 19:04)</a>:</h4>
<p>In case you’re interested, the setting is actually the code I posted above with the <code>impl&lt;T: A&gt; A for T</code> removed. (<a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=57ba6b8cff5922cce42b5567f94ac8d7">playground</a>, look at the bottom)</p>



<a name="237550889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237550889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237550889">(May 05 2021 at 19:17)</a>:</h4>
<p>If you compile that code you posted above but with </p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// asked directly:</span>
<span class="c1">// assert_impl!(((u8,),): A); // fails</span>
</code></pre></div>
<p>commented out, and then remove the <code>//</code> and compile again, you can get an ICE</p>
<div class="codehilite"><pre><span></span><code>thread &#39;rustc&#39; panicked at &#39;assertion failed: `(left == right)`
  left: `Some(Fingerprint(7515642617870997472, 10669738953425457651))`,
 right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(ee7939cc1800bb5a-204ab6fc5a30d80b): Ok(EvaluatedToErr)&#39;, /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.53.0-nightly (42816d61e 2021-04-24) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `((u8,),): A`
#1 [typeck] type-checking `_::g`
end of query stack
error: could not compile `small_pg`
</code></pre></div>



<a name="237553222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237553222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237553222">(May 05 2021 at 19:35)</a>:</h4>
<p>there are a <em>bunch</em> of those incremental failures related to the trait cache, like <a href="https://github.com/rust-lang/rust/issues/84335">#84335</a>. They may fall under the umbrella of <a href="https://github.com/rust-lang/rust/issues/83538">#83538</a> but the query stack is different so it's unsure</p>



<a name="237553425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237553425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237553425">(May 05 2021 at 19:37)</a>:</h4>
<p>your examples however are very small, compared to all the others, and it may be of interest to  <span class="user-mention" data-user-id="125294">@Aaron Hill</span></p>



<a name="237553462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237553462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237553462">(May 05 2021 at 19:37)</a>:</h4>
<p>so thanks a lot for those :)</p>



<a name="237556611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237556611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237556611">(May 05 2021 at 20:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116113">@lqd</span> <span class="user-mention" data-user-id="125294">@Aaron Hill</span> Here’s one without using unstable features:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="fm">macro_rules!</span><span class="w"> </span><span class="n">assert_impl</span><span class="w"> </span><span class="p">{(</span><span class="cp">$ty</span>:<span class="nc">ty</span>: <span class="cp">$($trait</span>:<span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">_</span>: <span class="p">()</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">f</span><span class="o">&lt;</span><span class="n">T</span>: <span class="cp">$($trait</span><span class="p">)</span><span class="o">*&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"> </span><span class="k">fn</span> <span class="nf">g</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">f</span>::<span class="o">&lt;</span><span class="cp">$ty</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">};</span><span class="w"></span>
<span class="p">}}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="n">T</span>: <span class="o">?</span><span class="nb">Sized</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">Self_</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="o">?</span><span class="nb">Sized</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Tr</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Self_</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="n">Self_</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">S</span><span class="o">&lt;</span><span class="n">T</span>: <span class="o">?</span><span class="nb">Sized</span><span class="o">&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">);</span><span class="w"></span>
<span class="k">type</span> <span class="nc">S10</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</span><span class="p">;</span><span class="w"></span>
<span class="k">type</span> <span class="nc">S50</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;&gt;&gt;&gt;</span><span class="p">;</span><span class="w"></span>
<span class="k">type</span> <span class="nc">S126</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">S50</span><span class="o">&lt;</span><span class="n">S50</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S10</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">S</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;</span><span class="p">;</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">New</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">D</span>: <span class="nb">Copy</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="n">S126</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;&gt;&gt;</span><span class="w"> </span><span class="n">New</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">New2</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="n">New2</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="kt">u8</span>: <span class="nc">New</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">New3</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="n">New3</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u8</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="kt">u8</span>: <span class="nc">New2</span><span class="o">&lt;</span><span class="n">D</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="c1">// asked directly would fail:</span>
<span class="c1">// assert_impl!(u8: New3&lt;()&gt;);</span>

<span class="c1">// first ask</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">Tr</span><span class="o">&lt;</span><span class="n">S126</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;&gt;</span><span class="p">);</span><span class="w"></span>

<span class="c1">// then ask</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">New3</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;</span><span class="p">);</span><span class="w"></span>
</code></pre></div>
<p>Again, if you compile the above and then uncomment the</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="c1">// asked directly would fail:</span>
<span class="n">assert_impl</span><span class="o">!</span><span class="p">(</span><span class="kt">u8</span>: <span class="nc">New3</span><span class="o">&lt;</span><span class="p">()</span><span class="o">&gt;</span><span class="p">);</span><span class="w"></span>
</code></pre></div>
<p>you’ll get the ICE with incremental compilation.</p>



<a name="237556748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237556748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237556748">(May 05 2021 at 20:03)</a>:</h4>
<p><span class="user-mention" data-user-id="280891">@Frank Steffahn</span> What error message is that giving you?</p>



<a name="237556756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237556756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237556756">(May 05 2021 at 20:03)</a>:</h4>
<p>when you get the ICE</p>



<a name="237556861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237556861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237556861">(May 05 2021 at 20:04)</a>:</h4>
<div class="codehilite"><pre><span></span><code>thread &#39;rustc&#39; panicked at &#39;assertion failed: `(left == right)`
  left: `Some(Fingerprint(16365582130792536210, 18134235757999171202))`,
 right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(8421af3104e8568e-1e4dde7bf5725838): Err(OverflowError)&#39;, /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&amp;template=ice.md

note: rustc 1.53.0-nightly (42816d61e 2021-04-24) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `u8: New3&lt;()&gt;`
#1 [typeck] type-checking `_::g`
end of query stack
</code></pre></div>



<a name="237557404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557404">(May 05 2021 at 20:08)</a>:</h4>
<p>Wow - this is a <em>different</em> incr comp issue with <code>evaluate_obligation</code></p>



<a name="237557422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557422">(May 05 2021 at 20:08)</a>:</h4>
<p>distinct from the one with <code>syn</code></p>



<a name="237557453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557453">(May 05 2021 at 20:08)</a>:</h4>
<p>Can you open an issue?</p>



<a name="237557530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557530">(May 05 2021 at 20:09)</a>:</h4>
<p>The <code>syn</code> issue occurs because the choice between <code>EvaluatedToOk</code> and <code>EvaluatedToOkModuloRegions</code> depends on global state</p>



<a name="237557549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557549">(May 05 2021 at 20:09)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> check out one of the cases in <a href="https://github.com/rust-lang/rust/issues/84335">#84335</a></p>



<a name="237557565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557565">(May 05 2021 at 20:09)</a>:</h4>
<p>that issue never involves <code>OverflowError</code></p>



<a name="237557576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557576">(May 05 2021 at 20:09)</a>:</h4>
<p>r-a triggers this one from typeck IIUC</p>



<a name="237557617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557617">(May 05 2021 at 20:10)</a>:</h4>
<p>(but could be wrong, I haven't looked at it as closely as you of course)</p>



<a name="237557666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557666">(May 05 2021 at 20:10)</a>:</h4>
<p>The <code>item_children</code> one will probably be fixed by <a href="https://github.com/rust-lang/rust/pull/83901/files">https://github.com/rust-lang/rust/pull/83901/files</a></p>



<a name="237557674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237557674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237557674">(May 05 2021 at 20:10)</a>:</h4>
<p>which should really get merged</p>



<a name="237560317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/marker_trait_attr%20stabilization/near/237560317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Frank Steffahn <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization.html#237560317">(May 05 2021 at 20:30)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125294">Aaron Hill</span> <a href="#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237557453">said</a>:</p>
<blockquote>
<p>Can you open an issue?</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rust/issues/84963">#84963</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>